﻿<local:BaseWindow x:Class="PDFRider.WndInsertPages"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:PDFRider"
    xmlns:ltl="clr-namespace:LocTranslate;assembly=LocTranslateLibrary"
    Title="{ltl:Translate loc_wndInsertPagesTitle}" Height="267" Width="360" WindowStartupLocation="CenterOwner" 
    ShowInTaskbar="False" ResizeMode="NoResize" Style="{StaticResource GenericStyle}" WindowStyle="SingleBorderWindow" Icon="/PDFRider;component/PDFRider.ico">
    <Window.Resources>
        <local:EnumBooleanConverter x:Key="enumBooleanConverter" />
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <StackPanel Orientation="Horizontal">
            <TextBlock Margin="5" Text="{ltl:Translate loc_fileToInsert}" />
            <TextBlock Margin="5" Text="{Binding FileNameToMerge}" />
        </StackPanel>
        
        <GroupBox Grid.Row="1" Header="{ltl:Translate loc_position}" Margin="5">
            <StackPanel>
                <RadioButton Margin="5" Content="{ltl:Translate loc_positionBeginning}"
                             IsChecked="{Binding Path=InsertPosition, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Beginning}"/>
                <RadioButton Margin="5" Content="{ltl:Translate loc_positionEnd}"
                             IsChecked="{Binding Path=InsertPosition, Converter={StaticResource enumBooleanConverter}, ConverterParameter=End}"/>
                <StackPanel Orientation="Horizontal">
                    <RadioButton Margin="5" VerticalAlignment="Center"
                                 Content="{ltl:Translate loc_positionCustom}"
                                 IsChecked="{Binding Path=InsertPosition, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Custom}"/>
                    <local:IntervalTextBox Style="{StaticResource IntervalTextBox}" SelectAllText="True"
                                   IsValidInterval="{Binding IsValidPageStart}"
                                   Text="{Binding PageStart, UpdateSourceTrigger=PropertyChanged}" />
                    <TextBlock Margin="5" Text="{ltl:Translate loc_tbkPagesOf}" VerticalAlignment="Center"/>
                    <TextBlock Margin="5" Text="{Binding NumberOfPages}" VerticalAlignment="Center"/>
                    <TextBlock Margin="5" Text="{Binding NumberOfPhysicalPages, StringFormat=({0})}" VerticalAlignment="Center" />
                </StackPanel>
                <TextBlock Style="{StaticResource InformationTextBlock}" Text="{Binding Information}"
                           VerticalAlignment="Center" />
            </StackPanel>
        </GroupBox>
        
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5">
            <Button Content="{ltl:Translate loc_btnOK}" Command="{Binding CmdInsert}"
                    Style="{StaticResource StandardRectangleDialogButton}" IsDefault="True" />
            <Button Content="{ltl:Translate loc_btnCancel}" Command="{Binding CmdClose}"
                    Style="{StaticResource StandardRectangleDialogButton}" IsCancel="True"/>
        </StackPanel>
    </Grid>
</local:BaseWindow>
